package apps.employeeapp;

import junit.framework.Assert;

import org.junit.Test;


public class UserTest {

    @Test
    public void hasAccessEmployeeTest() {
        String username = "E12345";
        String password = "test123";

        Employee emp = new Employee(username, password);
        boolean hasAccess = emp.hasAccess();
        Assert.assertEquals(true, hasAccess);
    }

    @Test
    public void hasAccessManagerTest() {
        String username = "E12345";
        String password = "test234";

        Manager manager = new Manager(username, password); // shall fail as entered username does not start with M.
        boolean hasAccess = manager.hasAccess();
        Assert.assertEquals(true, hasAccess);
    }
    
    @Test
    public void hasAccessDirectorTest() {
        String username = "sunil";
        String password = "sunil";

        Director director = new Director(username, password); // shall pass as director does not come in username policy.
        boolean hasAccess = director.hasAccess();
        Assert.assertEquals(true, hasAccess);
    }
}
